/*******************************************************************
//  OFDM Sender  
//     Constellation mapping -> IFFT
//   
//  Date : 04/11/2011
//  Jungmin Park
********************************************************************/

#include <stdio.h>
#include "constellation_mapping.h"
#include "FFT.h"

int main ()
{
	long a, b;
	float X_re[16];
	float X_im[16];
	float Y_re[16];
	float Y_im[16];
		
    int i;
	long temp;

	a = 0x1234abcd;            // input data 
	b = 0x36478fac;
	
	temp = a;
	for (i=0; i<16; i++)
	{
		 if (i == 8) temp=b;
		 constellation_mapping(temp, X_re+i, X_im+i);   
		 temp >>= 4;
		 
	}
	
	FFT (0, X_re, X_im, Y_re, Y_im);
	
	// Print the values

	printf ("-------- The input of IFFT ----------\n"); 
	for (i=0; i<16; i++)
	{
		printf ("X[%d] = %f+i%f \n", i, X_re[i], X_im[i]);
	}
	printf ("-------- The output of IFFT ----------\n"); 
	for (i=0; i<16; i++)
	{
		printf ("Y[%d] = %f+i%f \n", i, Y_re[i], Y_im[i]);
	}
	
	return 0;
}